<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
    >
      <el-form-item label="日期" prop="dataDate">
        <el-date-picker
          clearable
          v-model="queryParams.dataDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择日期"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >搜索</el-button
        >
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重置</el-button
        >
        <el-button
          :icon="!isOpen ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
          size="mini"
          @click="shouqi"
          >展开/收起</el-button
        >
      </el-form-item>

      <div v-if="isOpen">
        <el-form-item label="店铺id" prop="shopId">
          <el-input
            v-model="queryParams.shopId"
            placeholder="请输入店铺id"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <!-- <el-form-item label="日期" prop="dataDate">
        <el-date-picker clearable
          v-model="queryParams.dataDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择日期">
        </el-date-picker>
      </el-form-item> -->
        <el-form-item label="店铺名称" prop="shopName">
          <el-input
            v-model="queryParams.shopName"
            placeholder="请输入店铺名称"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="销售目标" prop="salesTarget">
          <el-input
            v-model="queryParams.salesTarget"
            placeholder="请输入销售目标"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="销售额" prop="saleAmount">
          <el-input
            v-model="queryParams.saleAmount"
            placeholder="请输入销售额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="退款金额" prop="returnAmount">
          <el-input
            v-model="queryParams.returnAmount"
            placeholder="请输入退款金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="净销售额" prop="netSalesAmount">
          <el-input
            v-model="queryParams.netSalesAmount"
            placeholder="请输入净销售额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="下单数" prop="ordersNumber">
          <el-input
            v-model="queryParams.ordersNumber"
            placeholder="请输入下单数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="客单价" prop="customerUnitPrice">
          <el-input
            v-model="queryParams.customerUnitPrice"
            placeholder="请输入客单价"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="商品销售成本" prop="saleCostPro">
          <el-input
            v-model="queryParams.saleCostPro"
            placeholder="请输入商品销售成本"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="退款率" prop="refundRate">
          <el-input
            v-model="queryParams.refundRate"
            placeholder="请输入退款率"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="支付买家数(成交人数)" prop="paidCustomers">
          <el-input
            v-model="queryParams.paidCustomers"
            placeholder="请输入支付买家数(成交人数)"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="ROI" prop="roi">
          <el-input
            v-model="queryParams.roi"
            placeholder="请输入ROI"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="新客数" prop="newCustomerCount">
          <el-input
            v-model="queryParams.newCustomerCount"
            placeholder="请输入新客数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="支付老买家数" prop="oldPaidCustomers">
          <el-input
            v-model="queryParams.oldPaidCustomers"
            placeholder="请输入支付老买家数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="支付新买家数" prop="newPaidCustomers">
          <el-input
            v-model="queryParams.newPaidCustomers"
            placeholder="请输入支付新买家数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="新客成交金额" prop="newCustomerSalesAmount">
          <el-input
            v-model="queryParams.newCustomerSalesAmount"
            placeholder="请输入新客成交金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="老客成交金额" prop="oldCustomerSalesAmount">
          <el-input
            v-model="queryParams.oldCustomerSalesAmount"
            placeholder="请输入老客成交金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="老客客单价" prop="oldCustomerUnitPrice">
          <el-input
            v-model="queryParams.oldCustomerUnitPrice"
            placeholder="请输入老客客单价"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="新客客单价" prop="newCustomerUnitPrice">
          <el-input
            v-model="queryParams.newCustomerUnitPrice"
            placeholder="请输入新客客单价"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="营销花费" prop="marketingCost">
          <el-input
            v-model="queryParams.marketingCost"
            placeholder="请输入营销花费"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="新增新客数" prop="newCustomerIncreaseCount">
          <el-input
            v-model="queryParams.newCustomerIncreaseCount"
            placeholder="请输入新增新客数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="退款订单数" prop="refundOrderCount">
          <el-input
            v-model="queryParams.refundOrderCount"
            placeholder="请输入退款订单数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="直播成交金额" prop="liveSalesAmount">
          <el-input
            v-model="queryParams.liveSalesAmount"
            placeholder="请输入直播成交金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="直播退款金额" prop="liveReturnAmount">
          <el-input
            v-model="queryParams.liveReturnAmount"
            placeholder="请输入直播退款金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="直播间曝光次数" prop="liveExposureCount">
          <el-input
            v-model="queryParams.liveExposureCount"
            placeholder="请输入直播间曝光次数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="直播成交人数" prop="liveSalesBuyerCount">
          <el-input
            v-model="queryParams.liveSalesBuyerCount"
            placeholder="请输入直播成交人数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="账号新增粉丝数" prop="newFansCount">
          <el-input
            v-model="queryParams.newFansCount"
            placeholder="请输入账号新增粉丝数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="商品成交件数" prop="productSoldCount">
          <el-input
            v-model="queryParams.productSoldCount"
            placeholder="请输入商品成交件数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="合作达人数" prop="cooperationInfluencerCount">
          <el-input
            v-model="queryParams.cooperationInfluencerCount"
            placeholder="请输入合作达人数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="人群总数" prop="targetAudienceTotalCount">
          <el-input
            v-model="queryParams.targetAudienceTotalCount"
            placeholder="请输入人群总数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="自营销售额" prop="selfOperatedSalesAmount">
          <el-input
            v-model="queryParams.selfOperatedSalesAmount"
            placeholder="请输入自营销售额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="自营退款金额" prop="selfOperatedReturnAmount">
          <el-input
            v-model="queryParams.selfOperatedReturnAmount"
            placeholder="请输入自营退款金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="自营退款率" prop="selfOperatedRefundRate">
          <el-input
            v-model="queryParams.selfOperatedRefundRate"
            placeholder="请输入自营退款率"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="自营成交订单数" prop="selfOperatedOrderCount">
          <el-input
            v-model="queryParams.selfOperatedOrderCount"
            placeholder="请输入自营成交订单数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="店铺商品访客数" prop="shopProductVisitorCount">
          <el-input
            v-model="queryParams.shopProductVisitorCount"
            placeholder="请输入店铺商品访客数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="自营商品点击次数"
          prop="selfOperatedProductClickCount"
        >
          <el-input
            v-model="queryParams.selfOperatedProductClickCount"
            placeholder="请输入自营商品点击次数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="自营商品点击转化率"
          prop="selfOperatedProductClickConversionRate"
        >
          <el-input
            v-model="queryParams.selfOperatedProductClickConversionRate"
            placeholder="请输入自营商品点击转化率"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="自营成交人数" prop="selfOperatedBuyerCount">
          <el-input
            v-model="queryParams.selfOperatedBuyerCount"
            placeholder="请输入自营成交人数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="自营客单价" prop="selfOperatedCustomerUnitPrice">
          <el-input
            v-model="queryParams.selfOperatedCustomerUnitPrice"
            placeholder="请输入自营客单价"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="自营直播销售额" prop="selfOperatedLiveSalesAmount">
          <el-input
            v-model="queryParams.selfOperatedLiveSalesAmount"
            placeholder="请输入自营直播销售额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="自营直播成交订单数"
          prop="selfOperatedLiveOrderCount"
        >
          <el-input
            v-model="queryParams.selfOperatedLiveOrderCount"
            placeholder="请输入自营直播成交订单数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="自营直播退款金额"
          prop="selfOperatedLiveReturnAmount"
        >
          <el-input
            v-model="queryParams.selfOperatedLiveReturnAmount"
            placeholder="请输入自营直播退款金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="自营短视频销售额"
          prop="selfOperatedVideoSalesAmount"
        >
          <el-input
            v-model="queryParams.selfOperatedVideoSalesAmount"
            placeholder="请输入自营短视频销售额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="自营短视频成交订单数"
          prop="selfOperatedVideoOrderCount"
        >
          <el-input
            v-model="queryParams.selfOperatedVideoOrderCount"
            placeholder="请输入自营短视频成交订单数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="自营短视频退款金额"
          prop="selfOperatedVideoReturnAmount"
        >
          <el-input
            v-model="queryParams.selfOperatedVideoReturnAmount"
            placeholder="请输入自营短视频退款金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="自营商品卡销售额"
          prop="selfOperatedProductCardSalesAmount"
        >
          <el-input
            v-model="queryParams.selfOperatedProductCardSalesAmount"
            placeholder="请输入自营商品卡销售额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="自营商品卡成交订单数"
          prop="selfOperatedProductCardOrderCount"
        >
          <el-input
            v-model="queryParams.selfOperatedProductCardOrderCount"
            placeholder="请输入自营商品卡成交订单数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="自营商品卡退款金额"
          prop="selfOperatedProductCardReturnAmount"
        >
          <el-input
            v-model="queryParams.selfOperatedProductCardReturnAmount"
            placeholder="请输入自营商品卡退款金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="自营其他" prop="selfOperatedOtherSalesAmount">
          <el-input
            v-model="queryParams.selfOperatedOtherSalesAmount"
            placeholder="请输入自营其他"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="自营其他成交订单数"
          prop="selfOperatedOtherOrderCount"
        >
          <el-input
            v-model="queryParams.selfOperatedOtherOrderCount"
            placeholder="请输入自营其他成交订单数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="自营其他退款金额"
          prop="selfOperatedOtherReturnAmount"
        >
          <el-input
            v-model="queryParams.selfOperatedOtherReturnAmount"
            placeholder="请输入自营其他退款金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="达人合作销售额"
          prop="influencerCooperationSalesAmount"
        >
          <el-input
            v-model="queryParams.influencerCooperationSalesAmount"
            placeholder="请输入达人合作销售额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="达人直播销售额" prop="influencerLiveSalesAmount">
          <el-input
            v-model="queryParams.influencerLiveSalesAmount"
            placeholder="请输入达人直播销售额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="达人商品卡销售额"
          prop="influencerProductCardSalesAmount"
        >
          <el-input
            v-model="queryParams.influencerProductCardSalesAmount"
            placeholder="请输入达人商品卡销售额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="达人其他" prop="influencerOtherSalesAmount">
          <el-input
            v-model="queryParams.influencerOtherSalesAmount"
            placeholder="请输入达人其他"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="达人短视频销售额"
          prop="influencerVideoSalesAmount"
        >
          <el-input
            v-model="queryParams.influencerVideoSalesAmount"
            placeholder="请输入达人短视频销售额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="自然流量订单数" prop="liveNaturalOrderCount">
          <el-input
            v-model="queryParams.liveNaturalOrderCount"
            placeholder="请输入自然流量订单数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="付费流量订单数" prop="livePaidOrderCount">
          <el-input
            v-model="queryParams.livePaidOrderCount"
            placeholder="请输入付费流量订单数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="直播成交订单数" prop="liveOrderCount">
          <el-input
            v-model="queryParams.liveOrderCount"
            placeholder="请输入直播成交订单数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="直播间观看次数" prop="liveViewCount">
          <el-input
            v-model="queryParams.liveViewCount"
            placeholder="请输入直播间观看次数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="直播间曝光观看率" prop="liveExposureViewRate">
          <el-input
            v-model="queryParams.liveExposureViewRate"
            placeholder="请输入直播间曝光观看率"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="直播间曝光成交率"
          prop="liveExposureConversionRate"
        >
          <el-input
            v-model="queryParams.liveExposureConversionRate"
            placeholder="请输入直播间曝光成交率"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="直播间支付转化率" prop="livePaymentConversionRate">
          <el-input
            v-model="queryParams.livePaymentConversionRate"
            placeholder="请输入直播间支付转化率"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="千次观看成交金额" prop="thousandViewSalesAmount">
          <el-input
            v-model="queryParams.thousandViewSalesAmount"
            placeholder="请输入千次观看成交金额"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="商品曝光总次数" prop="productExposureCount">
          <el-input
            v-model="queryParams.productExposureCount"
            placeholder="请输入商品曝光总次数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="商品曝光点击率" prop="productExposureClickRate">
          <el-input
            v-model="queryParams.productExposureClickRate"
            placeholder="请输入商品曝光点击率"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="商品点击成交率" prop="productClickConversionRate">
          <el-input
            v-model="queryParams.productClickConversionRate"
            placeholder="请输入商品点击成交率"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="观看商品曝光率" prop="viewProductExposureRate">
          <el-input
            v-model="queryParams.viewProductExposureRate"
            placeholder="请输入观看商品曝光率"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item
          label="直播间商品曝光次数"
          prop="liveProductExposureCount"
        >
          <el-input
            v-model="queryParams.liveProductExposureCount"
            placeholder="请输入直播间商品曝光次数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="直播间商品点击次数" prop="liveProductClickCount">
          <el-input
            v-model="queryParams.liveProductClickCount"
            placeholder="请输入直播间商品点击次数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="直播商品成交件数" prop="liveProductSalesCount">
          <el-input
            v-model="queryParams.liveProductSalesCount"
            placeholder="请输入直播商品成交件数"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="人均观看时长" prop="averageViewDuration">
          <el-input
            v-model="queryParams.averageViewDuration"
            placeholder="请输入人均观看时长"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="直播ROI" prop="liveRoi">
          <el-input
            v-model="queryParams.liveRoi"
            placeholder="请输入直播ROI"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="年" prop="dataYear">
          <el-input
            v-model="queryParams.dataYear"
            placeholder="请输入年"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="季度" prop="dataQuarter">
          <el-input
            v-model="queryParams.dataQuarter"
            placeholder="请输入季度"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="月" prop="dataMonth">
          <el-input
            v-model="queryParams.dataMonth"
            placeholder="请输入月"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="周" prop="dataWeek">
          <el-input
            v-model="queryParams.dataWeek"
            placeholder="请输入周"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
      </div>
      <!-- <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item> -->
    </el-form>
    <el-row>
      <el-col :span="9">
        <timeSearch
          @getDateArr="getDateArr"
          @changDay="changDay"
          :timeArr="timeArr"
          :dayActive="this.dayActive"
          :dayLimit="1095"
        />
      </el-col>
    </el-row>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['sale:BiDySaleDwd:add']"
          >新增</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['sale:BiDySaleDwd:edit']"
          >修改</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['sale:BiDySaleDwd:remove']"
          >删除</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['sale:BiDySaleDwd:export']"
          >导出</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-refresh"
          size="mini"
          @click="handleRefresh"
          >同步数据</el-button
        >
      </el-col>
      <!-- <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-refresh"
          size="mini"
          @click="handleRefresh"
          >同步</el-button
        >
      </el-col> -->
      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>

    <el-table
      :height="650"
      v-loading="loading"
      :data="BiDySaleDwdList"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="id" align="center" prop="id" />
      <el-table-column label="店铺id" align="center" prop="shopId" />
      <el-table-column label="日期" align="center" prop="dataDate">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.dataDate, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column label="店铺名称" align="center" prop="shopName" />
      <el-table-column label="销售目标" align="center" prop="selfSalesTarget" />
      <el-table-column label="销售额" align="center" prop="saleAmount" />
      <el-table-column label="退款金额" align="center" prop="returnAmount" />
      <el-table-column label="净销售额" align="center" prop="netSalesAmount" />
      <el-table-column label="下单数" align="center" prop="ordersNumber" />
      <el-table-column label="客单价" align="center" prop="customerUnitPrice" />
      <el-table-column label="商品销售成本" align="center" prop="saleCostPro" />
      <el-table-column label="退款率" align="center" prop="refundRate" />
      <el-table-column
        width="180"
        label="支付买家数(成交人数)"
        align="center"
        prop="paidCustomers"
      />
      <el-table-column label="ROI" align="center" prop="roi" />
      <el-table-column label="新客数" align="center" prop="newCustomerCount" />
      <el-table-column
        label="支付老买家数"
        align="center"
        prop="oldPaidCustomers"
      />
      <el-table-column
        label="支付新买家数"
        align="center"
        prop="newPaidCustomers"
      />
      <el-table-column
        label="新客成交金额"
        align="center"
        prop="newCustomerSalesAmount"
      />
      <el-table-column
        label="老客成交金额"
        align="center"
        prop="oldCustomerSalesAmount"
      />
      <el-table-column
        label="老客客单价"
        align="center"
        prop="oldCustomerUnitPrice"
      />
      <el-table-column
        label="新客客单价"
        align="center"
        prop="newCustomerUnitPrice"
      />
      <el-table-column label="营销花费" align="center" prop="marketingCost" />
      <el-table-column
        label="新增新客数"
        align="center"
        prop="newCustomerIncreaseCount"
      />
      <el-table-column
        label="退款订单数"
        align="center"
        prop="refundOrderCount"
      />
      <el-table-column
        label="直播成交金额"
        align="center"
        prop="liveSalesAmount"
      />
      <el-table-column
        label="直播退款金额"
        align="center"
        prop="liveReturnAmount"
      />
      <el-table-column
        label="直播间曝光次数"
        align="center"
        prop="liveExposureCount"
      />
      <el-table-column
        label="直播成交人数"
        align="center"
        prop="liveSalesBuyerCount"
      />
      <el-table-column
        label="账号新增粉丝数"
        align="center"
        prop="newFansCount"
      />
      <el-table-column
        label="商品成交件数"
        align="center"
        prop="productSoldCount"
      />
      <el-table-column
        label="合作达人数"
        align="center"
        prop="cooperationInfluencerCount"
      />
      <el-table-column
        label="人群总数"
        align="center"
        prop="targetAudienceTotalCount"
      />
      <el-table-column
        label="自营销售额"
        align="center"
        prop="selfOperatedSalesAmount"
      />
      <el-table-column
        label="自营退款金额"
        align="center"
        prop="selfOperatedReturnAmount"
      />
      <el-table-column
        label="自营退款率"
        align="center"
        prop="selfOperatedRefundRate"
      />
      <el-table-column
        label="自营成交订单数"
        align="center"
        prop="selfOperatedOrderCount"
      />
      <el-table-column
        label="店铺商品访客数"
        align="center"
        prop="shopProductVisitorCount"
      />
      <el-table-column
        label="自营商品点击次数"
        align="center"
        prop="selfOperatedProductClickCount"
      />
      <el-table-column
        label="自营商品点击转化率"
        align="center"
        prop="selfOperatedProductClickConversionRate"
      />
      <el-table-column
        label="自营成交人数"
        align="center"
        prop="selfOperatedBuyerCount"
      />
      <el-table-column
        label="自营客单价"
        align="center"
        prop="selfOperatedCustomerUnitPrice"
      />
      <el-table-column
        label="自营直播销售额"
        align="center"
        prop="selfOperatedLiveSalesAmount"
      />
      <el-table-column
        label="自营直播成交订单数"
        align="center"
        prop="selfOperatedLiveOrderCount"
      />
      <el-table-column
        label="自营直播退款金额"
        align="center"
        prop="selfOperatedLiveReturnAmount"
      />
      <el-table-column
        label="自营短视频销售额"
        align="center"
        prop="selfOperatedVideoSalesAmount"
      />
      <el-table-column
        label="自营短视频成交订单数"
        align="center"
        prop="selfOperatedVideoOrderCount"
      />
      <el-table-column
        label="自营短视频退款金额"
        align="center"
        prop="selfOperatedVideoReturnAmount"
      />
      <el-table-column
        label="自营商品卡销售额"
        align="center"
        prop="selfOperatedProductCardSalesAmount"
      />
      <el-table-column
        label="自营商品卡成交订单数"
        align="center"
        prop="selfOperatedProductCardOrderCount"
      />
      <el-table-column
        label="自营商品卡退款金额"
        align="center"
        prop="selfOperatedProductCardReturnAmount"
      />
      <el-table-column
        label="自营其他"
        align="center"
        prop="selfOperatedOtherSalesAmount"
      />
      <el-table-column
        label="自营其他成交订单数"
        align="center"
        prop="selfOperatedOtherOrderCount"
      />
      <el-table-column
        label="自营其他退款金额"
        align="center"
        prop="selfOperatedOtherReturnAmount"
      />
      <el-table-column
        label="达人合作销售额"
        align="center"
        prop="influencerCooperationSalesAmount"
      />
      <el-table-column
        label="达人直播销售额"
        align="center"
        prop="influencerLiveSalesAmount"
      />
      <el-table-column
        label="达人商品卡销售额"
        align="center"
        prop="influencerProductCardSalesAmount"
      />
      <el-table-column
        label="达人其他"
        align="center"
        prop="influencerOtherSalesAmount"
      />
      <el-table-column
        label="达人短视频销售额"
        align="center"
        prop="influencerVideoSalesAmount"
      />
      <el-table-column
        label="自然流量订单数"
        align="center"
        prop="liveNaturalOrderCount"
      />
      <el-table-column
        label="付费流量订单数"
        align="center"
        prop="livePaidOrderCount"
      />
      <el-table-column
        label="直播成交订单数"
        align="center"
        prop="liveOrderCount"
      />
      <el-table-column
        label="直播间观看次数"
        align="center"
        prop="liveViewCount"
      />
      <el-table-column
        label="直播间曝光观看率"
        align="center"
        prop="liveExposureViewRate"
      />
      <el-table-column
        label="直播间曝光成交率"
        align="center"
        prop="liveExposureConversionRate"
      />
      <el-table-column
        label="直播间支付转化率"
        align="center"
        prop="livePaymentConversionRate"
      />
      <el-table-column
        label="千次观看成交金额"
        align="center"
        prop="thousandViewSalesAmount"
      />
      <el-table-column
        label="商品曝光总次数"
        align="center"
        prop="productExposureCount"
      />
      <el-table-column
        label="商品曝光点击率"
        align="center"
        prop="productExposureClickRate"
      />
      <el-table-column
        label="商品点击成交率"
        align="center"
        prop="productClickConversionRate"
      />
      <el-table-column
        label="观看商品曝光率"
        align="center"
        prop="viewProductExposureRate"
      />
      <el-table-column
        label="直播间商品曝光次数"
        align="center"
        prop="liveProductExposureCount"
      />
      <el-table-column
        label="直播间商品点击次数"
        align="center"
        prop="liveProductClickCount"
      />
      <el-table-column
        label="直播商品成交件数"
        align="center"
        prop="liveProductSalesCount"
      />
      <el-table-column
        label="人均观看时长"
        align="center"
        prop="averageViewDuration"
      />
      <el-table-column label="直播ROI" align="center" prop="liveRoi" />
      <el-table-column label="年" align="center" prop="dataYear" />
      <el-table-column label="季度" align="center" prop="dataQuarter" />
      <el-table-column label="月" align="center" prop="dataMonth" />
      <el-table-column label="周" align="center" prop="dataWeek" />
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['sale:BiDySaleDwd:edit']"
            >修改</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['sale:BiDySaleDwd:remove']"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改抖系销售营销数据对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="店铺id" prop="shopId">
          <el-input v-model="form.shopId" placeholder="请输入店铺id" />
        </el-form-item>
        <el-form-item label="日期" prop="dataDate">
          <el-date-picker
            clearable
            v-model="form.dataDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择日期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="店铺名称" prop="shopName">
          <el-input v-model="form.shopName" placeholder="请输入店铺名称" />
        </el-form-item>
        <el-form-item label="销售目标" prop="salesTarget">
          <el-input v-model="form.salesTarget" placeholder="请输入销售目标" />
        </el-form-item>
        <el-form-item label="销售额" prop="saleAmount">
          <el-input v-model="form.saleAmount" placeholder="请输入销售额" />
        </el-form-item>
        <el-form-item label="退款金额" prop="returnAmount">
          <el-input v-model="form.returnAmount" placeholder="请输入退款金额" />
        </el-form-item>
        <el-form-item label="净销售额" prop="netSalesAmount">
          <el-input
            v-model="form.netSalesAmount"
            placeholder="请输入净销售额"
          />
        </el-form-item>
        <el-form-item label="下单数" prop="ordersNumber">
          <el-input v-model="form.ordersNumber" placeholder="请输入下单数" />
        </el-form-item>
        <el-form-item label="客单价" prop="customerUnitPrice">
          <el-input
            v-model="form.customerUnitPrice"
            placeholder="请输入客单价"
          />
        </el-form-item>
        <el-form-item label="商品销售成本" prop="saleCostPro">
          <el-input
            v-model="form.saleCostPro"
            placeholder="请输入商品销售成本"
          />
        </el-form-item>
        <el-form-item label="退款率" prop="refundRate">
          <el-input v-model="form.refundRate" placeholder="请输入退款率" />
        </el-form-item>
        <el-form-item label="支付买家数(成交人数)" prop="paidCustomers">
          <el-input
            v-model="form.paidCustomers"
            placeholder="请输入支付买家数(成交人数)"
          />
        </el-form-item>
        <el-form-item label="ROI" prop="roi">
          <el-input v-model="form.roi" placeholder="请输入ROI" />
        </el-form-item>
        <el-form-item label="新客数" prop="newCustomerCount">
          <el-input
            v-model="form.newCustomerCount"
            placeholder="请输入新客数"
          />
        </el-form-item>
        <el-form-item label="支付老买家数" prop="oldPaidCustomers">
          <el-input
            v-model="form.oldPaidCustomers"
            placeholder="请输入支付老买家数"
          />
        </el-form-item>
        <el-form-item label="支付新买家数" prop="newPaidCustomers">
          <el-input
            v-model="form.newPaidCustomers"
            placeholder="请输入支付新买家数"
          />
        </el-form-item>
        <el-form-item label="新客成交金额" prop="newCustomerSalesAmount">
          <el-input
            v-model="form.newCustomerSalesAmount"
            placeholder="请输入新客成交金额"
          />
        </el-form-item>
        <el-form-item label="老客成交金额" prop="oldCustomerSalesAmount">
          <el-input
            v-model="form.oldCustomerSalesAmount"
            placeholder="请输入老客成交金额"
          />
        </el-form-item>
        <el-form-item label="老客客单价" prop="oldCustomerUnitPrice">
          <el-input
            v-model="form.oldCustomerUnitPrice"
            placeholder="请输入老客客单价"
          />
        </el-form-item>
        <el-form-item label="新客客单价" prop="newCustomerUnitPrice">
          <el-input
            v-model="form.newCustomerUnitPrice"
            placeholder="请输入新客客单价"
          />
        </el-form-item>
        <el-form-item label="营销花费" prop="marketingCost">
          <el-input v-model="form.marketingCost" placeholder="请输入营销花费" />
        </el-form-item>
        <el-form-item label="新增新客数" prop="newCustomerIncreaseCount">
          <el-input
            v-model="form.newCustomerIncreaseCount"
            placeholder="请输入新增新客数"
          />
        </el-form-item>
        <el-form-item label="退款订单数" prop="refundOrderCount">
          <el-input
            v-model="form.refundOrderCount"
            placeholder="请输入退款订单数"
          />
        </el-form-item>
        <el-form-item label="直播成交金额" prop="liveSalesAmount">
          <el-input
            v-model="form.liveSalesAmount"
            placeholder="请输入直播成交金额"
          />
        </el-form-item>
        <el-form-item label="直播退款金额" prop="liveReturnAmount">
          <el-input
            v-model="form.liveReturnAmount"
            placeholder="请输入直播退款金额"
          />
        </el-form-item>
        <el-form-item label="直播间曝光次数" prop="liveExposureCount">
          <el-input
            v-model="form.liveExposureCount"
            placeholder="请输入直播间曝光次数"
          />
        </el-form-item>
        <el-form-item label="直播成交人数" prop="liveSalesBuyerCount">
          <el-input
            v-model="form.liveSalesBuyerCount"
            placeholder="请输入直播成交人数"
          />
        </el-form-item>
        <el-form-item label="账号新增粉丝数" prop="newFansCount">
          <el-input
            v-model="form.newFansCount"
            placeholder="请输入账号新增粉丝数"
          />
        </el-form-item>
        <el-form-item label="商品成交件数" prop="productSoldCount">
          <el-input
            v-model="form.productSoldCount"
            placeholder="请输入商品成交件数"
          />
        </el-form-item>
        <el-form-item label="合作达人数" prop="cooperationInfluencerCount">
          <el-input
            v-model="form.cooperationInfluencerCount"
            placeholder="请输入合作达人数"
          />
        </el-form-item>
        <el-form-item label="人群总数" prop="targetAudienceTotalCount">
          <el-input
            v-model="form.targetAudienceTotalCount"
            placeholder="请输入人群总数"
          />
        </el-form-item>
        <el-form-item label="自营销售额" prop="selfOperatedSalesAmount">
          <el-input
            v-model="form.selfOperatedSalesAmount"
            placeholder="请输入自营销售额"
          />
        </el-form-item>
        <el-form-item label="自营退款金额" prop="selfOperatedReturnAmount">
          <el-input
            v-model="form.selfOperatedReturnAmount"
            placeholder="请输入自营退款金额"
          />
        </el-form-item>
        <el-form-item label="自营退款率" prop="selfOperatedRefundRate">
          <el-input
            v-model="form.selfOperatedRefundRate"
            placeholder="请输入自营退款率"
          />
        </el-form-item>
        <el-form-item label="自营成交订单数" prop="selfOperatedOrderCount">
          <el-input
            v-model="form.selfOperatedOrderCount"
            placeholder="请输入自营成交订单数"
          />
        </el-form-item>
        <el-form-item label="店铺商品访客数" prop="shopProductVisitorCount">
          <el-input
            v-model="form.shopProductVisitorCount"
            placeholder="请输入店铺商品访客数"
          />
        </el-form-item>
        <el-form-item
          label="自营商品点击次数"
          prop="selfOperatedProductClickCount"
        >
          <el-input
            v-model="form.selfOperatedProductClickCount"
            placeholder="请输入自营商品点击次数"
          />
        </el-form-item>
        <el-form-item
          label="自营商品点击转化率"
          prop="selfOperatedProductClickConversionRate"
        >
          <el-input
            v-model="form.selfOperatedProductClickConversionRate"
            placeholder="请输入自营商品点击转化率"
          />
        </el-form-item>
        <el-form-item label="自营成交人数" prop="selfOperatedBuyerCount">
          <el-input
            v-model="form.selfOperatedBuyerCount"
            placeholder="请输入自营成交人数"
          />
        </el-form-item>
        <el-form-item label="自营客单价" prop="selfOperatedCustomerUnitPrice">
          <el-input
            v-model="form.selfOperatedCustomerUnitPrice"
            placeholder="请输入自营客单价"
          />
        </el-form-item>
        <el-form-item label="自营直播销售额" prop="selfOperatedLiveSalesAmount">
          <el-input
            v-model="form.selfOperatedLiveSalesAmount"
            placeholder="请输入自营直播销售额"
          />
        </el-form-item>
        <el-form-item
          label="自营直播成交订单数"
          prop="selfOperatedLiveOrderCount"
        >
          <el-input
            v-model="form.selfOperatedLiveOrderCount"
            placeholder="请输入自营直播成交订单数"
          />
        </el-form-item>
        <el-form-item
          label="自营直播退款金额"
          prop="selfOperatedLiveReturnAmount"
        >
          <el-input
            v-model="form.selfOperatedLiveReturnAmount"
            placeholder="请输入自营直播退款金额"
          />
        </el-form-item>
        <el-form-item
          label="自营短视频销售额"
          prop="selfOperatedVideoSalesAmount"
        >
          <el-input
            v-model="form.selfOperatedVideoSalesAmount"
            placeholder="请输入自营短视频销售额"
          />
        </el-form-item>
        <el-form-item
          label="自营短视频成交订单数"
          prop="selfOperatedVideoOrderCount"
        >
          <el-input
            v-model="form.selfOperatedVideoOrderCount"
            placeholder="请输入自营短视频成交订单数"
          />
        </el-form-item>
        <el-form-item
          label="自营短视频退款金额"
          prop="selfOperatedVideoReturnAmount"
        >
          <el-input
            v-model="form.selfOperatedVideoReturnAmount"
            placeholder="请输入自营短视频退款金额"
          />
        </el-form-item>
        <el-form-item
          label="自营商品卡销售额"
          prop="selfOperatedProductCardSalesAmount"
        >
          <el-input
            v-model="form.selfOperatedProductCardSalesAmount"
            placeholder="请输入自营商品卡销售额"
          />
        </el-form-item>
        <el-form-item
          label="自营商品卡成交订单数"
          prop="selfOperatedProductCardOrderCount"
        >
          <el-input
            v-model="form.selfOperatedProductCardOrderCount"
            placeholder="请输入自营商品卡成交订单数"
          />
        </el-form-item>
        <el-form-item
          label="自营商品卡退款金额"
          prop="selfOperatedProductCardReturnAmount"
        >
          <el-input
            v-model="form.selfOperatedProductCardReturnAmount"
            placeholder="请输入自营商品卡退款金额"
          />
        </el-form-item>
        <el-form-item label="自营其他" prop="selfOperatedOtherSalesAmount">
          <el-input
            v-model="form.selfOperatedOtherSalesAmount"
            placeholder="请输入自营其他"
          />
        </el-form-item>
        <el-form-item
          label="自营其他成交订单数"
          prop="selfOperatedOtherOrderCount"
        >
          <el-input
            v-model="form.selfOperatedOtherOrderCount"
            placeholder="请输入自营其他成交订单数"
          />
        </el-form-item>
        <el-form-item
          label="自营其他退款金额"
          prop="selfOperatedOtherReturnAmount"
        >
          <el-input
            v-model="form.selfOperatedOtherReturnAmount"
            placeholder="请输入自营其他退款金额"
          />
        </el-form-item>
        <el-form-item
          label="达人合作销售额"
          prop="influencerCooperationSalesAmount"
        >
          <el-input
            v-model="form.influencerCooperationSalesAmount"
            placeholder="请输入达人合作销售额"
          />
        </el-form-item>
        <el-form-item label="达人直播销售额" prop="influencerLiveSalesAmount">
          <el-input
            v-model="form.influencerLiveSalesAmount"
            placeholder="请输入达人直播销售额"
          />
        </el-form-item>
        <el-form-item
          label="达人商品卡销售额"
          prop="influencerProductCardSalesAmount"
        >
          <el-input
            v-model="form.influencerProductCardSalesAmount"
            placeholder="请输入达人商品卡销售额"
          />
        </el-form-item>
        <el-form-item label="达人其他" prop="influencerOtherSalesAmount">
          <el-input
            v-model="form.influencerOtherSalesAmount"
            placeholder="请输入达人其他"
          />
        </el-form-item>
        <el-form-item
          label="达人短视频销售额"
          prop="influencerVideoSalesAmount"
        >
          <el-input
            v-model="form.influencerVideoSalesAmount"
            placeholder="请输入达人短视频销售额"
          />
        </el-form-item>
        <el-form-item label="自然流量订单数" prop="liveNaturalOrderCount">
          <el-input
            v-model="form.liveNaturalOrderCount"
            placeholder="请输入自然流量订单数"
          />
        </el-form-item>
        <el-form-item label="付费流量订单数" prop="livePaidOrderCount">
          <el-input
            v-model="form.livePaidOrderCount"
            placeholder="请输入付费流量订单数"
          />
        </el-form-item>
        <el-form-item label="直播成交订单数" prop="liveOrderCount">
          <el-input
            v-model="form.liveOrderCount"
            placeholder="请输入直播成交订单数"
          />
        </el-form-item>
        <el-form-item label="直播间观看次数" prop="liveViewCount">
          <el-input
            v-model="form.liveViewCount"
            placeholder="请输入直播间观看次数"
          />
        </el-form-item>
        <el-form-item label="直播间曝光观看率" prop="liveExposureViewRate">
          <el-input
            v-model="form.liveExposureViewRate"
            placeholder="请输入直播间曝光观看率"
          />
        </el-form-item>
        <el-form-item
          label="直播间曝光成交率"
          prop="liveExposureConversionRate"
        >
          <el-input
            v-model="form.liveExposureConversionRate"
            placeholder="请输入直播间曝光成交率"
          />
        </el-form-item>
        <el-form-item label="直播间支付转化率" prop="livePaymentConversionRate">
          <el-input
            v-model="form.livePaymentConversionRate"
            placeholder="请输入直播间支付转化率"
          />
        </el-form-item>
        <el-form-item label="千次观看成交金额" prop="thousandViewSalesAmount">
          <el-input
            v-model="form.thousandViewSalesAmount"
            placeholder="请输入千次观看成交金额"
          />
        </el-form-item>
        <el-form-item label="商品曝光总次数" prop="productExposureCount">
          <el-input
            v-model="form.productExposureCount"
            placeholder="请输入商品曝光总次数"
          />
        </el-form-item>
        <el-form-item label="商品曝光点击率" prop="productExposureClickRate">
          <el-input
            v-model="form.productExposureClickRate"
            placeholder="请输入商品曝光点击率"
          />
        </el-form-item>
        <el-form-item label="商品点击成交率" prop="productClickConversionRate">
          <el-input
            v-model="form.productClickConversionRate"
            placeholder="请输入商品点击成交率"
          />
        </el-form-item>
        <el-form-item label="观看商品曝光率" prop="viewProductExposureRate">
          <el-input
            v-model="form.viewProductExposureRate"
            placeholder="请输入观看商品曝光率"
          />
        </el-form-item>
        <el-form-item
          label="直播间商品曝光次数"
          prop="liveProductExposureCount"
        >
          <el-input
            v-model="form.liveProductExposureCount"
            placeholder="请输入直播间商品曝光次数"
          />
        </el-form-item>
        <el-form-item label="直播间商品点击次数" prop="liveProductClickCount">
          <el-input
            v-model="form.liveProductClickCount"
            placeholder="请输入直播间商品点击次数"
          />
        </el-form-item>
        <el-form-item label="直播商品成交件数" prop="liveProductSalesCount">
          <el-input
            v-model="form.liveProductSalesCount"
            placeholder="请输入直播商品成交件数"
          />
        </el-form-item>
        <el-form-item label="人均观看时长" prop="averageViewDuration">
          <el-input
            v-model="form.averageViewDuration"
            placeholder="请输入人均观看时长"
          />
        </el-form-item>
        <el-form-item label="直播ROI" prop="liveRoi">
          <el-input v-model="form.liveRoi" placeholder="请输入直播ROI" />
        </el-form-item>
        <el-form-item label="年" prop="dataYear">
          <el-input v-model="form.dataYear" placeholder="请输入年" />
        </el-form-item>
        <el-form-item label="季度" prop="dataQuarter">
          <el-input v-model="form.dataQuarter" placeholder="请输入季度" />
        </el-form-item>
        <el-form-item label="月" prop="dataMonth">
          <el-input v-model="form.dataMonth" placeholder="请输入月" />
        </el-form-item>
        <el-form-item label="周" prop="dataWeek">
          <el-input v-model="form.dataWeek" placeholder="请输入周" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  listBiDySaleDwd,
  getBiDySaleDwd,
  delBiDySaleDwd,
  addBiDySaleDwd,
  updateBiDySaleDwd,
  synData,
} from "@/api/sale/BiDySaleDwd";
import timeSearch from "@/common/day";
export default {
  name: "BiDySaleDwd",
  components: { timeSearch },
  data() {
    return {
      dayActive: 2,
      timeArr: [
        { value: "2", label: "昨天" },
        { value: "7", label: "最近7天" },
        { value: "30", label: "最近30天" },
        { value: "365", label: "最近一年" },
        { value: "1", label: "日" },
      ],
      timeGap: { startTime: "", endTime: "" },
      isOpen: false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 抖系销售营销数据表格数据
      BiDySaleDwdList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        shopId: null,
        dataDate: null,
        shopName: null,
        salesTarget: null,
        saleAmount: null,
        returnAmount: null,
        netSalesAmount: null,
        ordersNumber: null,
        customerUnitPrice: null,
        saleCostPro: null,
        refundRate: null,
        paidCustomers: null,
        roi: null,
        newCustomerCount: null,
        oldPaidCustomers: null,
        newPaidCustomers: null,
        newCustomerSalesAmount: null,
        oldCustomerSalesAmount: null,
        oldCustomerUnitPrice: null,
        newCustomerUnitPrice: null,
        marketingCost: null,
        newCustomerIncreaseCount: null,
        refundOrderCount: null,
        liveSalesAmount: null,
        liveReturnAmount: null,
        liveExposureCount: null,
        liveSalesBuyerCount: null,
        newFansCount: null,
        productSoldCount: null,
        cooperationInfluencerCount: null,
        targetAudienceTotalCount: null,
        selfOperatedSalesAmount: null,
        selfOperatedReturnAmount: null,
        selfOperatedRefundRate: null,
        selfOperatedOrderCount: null,
        shopProductVisitorCount: null,
        selfOperatedProductClickCount: null,
        selfOperatedProductClickConversionRate: null,
        selfOperatedBuyerCount: null,
        selfOperatedCustomerUnitPrice: null,
        selfOperatedLiveSalesAmount: null,
        selfOperatedLiveOrderCount: null,
        selfOperatedLiveReturnAmount: null,
        selfOperatedVideoSalesAmount: null,
        selfOperatedVideoOrderCount: null,
        selfOperatedVideoReturnAmount: null,
        selfOperatedProductCardSalesAmount: null,
        selfOperatedProductCardOrderCount: null,
        selfOperatedProductCardReturnAmount: null,
        selfOperatedOtherSalesAmount: null,
        selfOperatedOtherOrderCount: null,
        selfOperatedOtherReturnAmount: null,
        influencerCooperationSalesAmount: null,
        influencerLiveSalesAmount: null,
        influencerProductCardSalesAmount: null,
        influencerOtherSalesAmount: null,
        influencerVideoSalesAmount: null,
        liveNaturalOrderCount: null,
        livePaidOrderCount: null,
        liveOrderCount: null,
        liveViewCount: null,
        liveExposureViewRate: null,
        liveExposureConversionRate: null,
        livePaymentConversionRate: null,
        thousandViewSalesAmount: null,
        productExposureCount: null,
        productExposureClickRate: null,
        productClickConversionRate: null,
        viewProductExposureRate: null,
        liveProductExposureCount: null,
        liveProductClickCount: null,
        liveProductSalesCount: null,
        averageViewDuration: null,
        liveRoi: null,
        dataYear: null,
        dataQuarter: null,
        dataMonth: null,
        dataWeek: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        shopId: [
          { required: true, message: "店铺id不能为空", trigger: "blur" },
        ],
        dataDate: [
          { required: true, message: "日期不能为空", trigger: "blur" },
        ],
      },
    };
  },
  created() {
    this.getList();
  },
  methods: {
    // 打开加载层
    openLoading() {
      this.$modal.loading("正在加载数据，请稍候！");
    },
    /** 刷新缓存按钮操作 Warning*/
    handleRefresh() {
      // this.$modal.msgWarning("数据正在同步，请稍候");

      const obj = {
        startTime: this.timeGap.startTime,
        endTime: this.timeGap.endTime,
      };
      this.openLoading();
      synData(obj).then(() => {
        this.$modal.closeLoading();
        this.$modal.msgSuccess("同步数据成功");
        this.getList();
        // this.$store.dispatch('dict/cleanDict');
      });
    },
    //时间控件
    changDay(val) {
      this.dayActive = val;
      this.timeGap.startTime = val[0];
      this.timeGap.endTime = val[1];
    },
    getDateArr(value) {
      this.timeGap.startTime = value[0];
      this.timeGap.endTime = value[1];
      console.log(JSON.stringify(this.timeGap));
      this.dayActive = 1;
    },
    //搜索栏展示与收起
    shouqi() {
      // console.log(1);
      this.isOpen = !this.isOpen;
    },
    /** 查询抖系销售营销数据列表 */
    getList() {
      this.loading = true;
      listBiDySaleDwd(this.queryParams).then((response) => {
        this.BiDySaleDwdList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        shopId: null,
        dataDate: null,
        shopName: null,
        salesTarget: null,
        saleAmount: null,
        returnAmount: null,
        netSalesAmount: null,
        ordersNumber: null,
        customerUnitPrice: null,
        saleCostPro: null,
        refundRate: null,
        paidCustomers: null,
        roi: null,
        newCustomerCount: null,
        oldPaidCustomers: null,
        newPaidCustomers: null,
        newCustomerSalesAmount: null,
        oldCustomerSalesAmount: null,
        oldCustomerUnitPrice: null,
        newCustomerUnitPrice: null,
        marketingCost: null,
        newCustomerIncreaseCount: null,
        refundOrderCount: null,
        liveSalesAmount: null,
        liveReturnAmount: null,
        liveExposureCount: null,
        liveSalesBuyerCount: null,
        newFansCount: null,
        productSoldCount: null,
        cooperationInfluencerCount: null,
        targetAudienceTotalCount: null,
        selfOperatedSalesAmount: null,
        selfOperatedReturnAmount: null,
        selfOperatedRefundRate: null,
        selfOperatedOrderCount: null,
        shopProductVisitorCount: null,
        selfOperatedProductClickCount: null,
        selfOperatedProductClickConversionRate: null,
        selfOperatedBuyerCount: null,
        selfOperatedCustomerUnitPrice: null,
        selfOperatedLiveSalesAmount: null,
        selfOperatedLiveOrderCount: null,
        selfOperatedLiveReturnAmount: null,
        selfOperatedVideoSalesAmount: null,
        selfOperatedVideoOrderCount: null,
        selfOperatedVideoReturnAmount: null,
        selfOperatedProductCardSalesAmount: null,
        selfOperatedProductCardOrderCount: null,
        selfOperatedProductCardReturnAmount: null,
        selfOperatedOtherSalesAmount: null,
        selfOperatedOtherOrderCount: null,
        selfOperatedOtherReturnAmount: null,
        influencerCooperationSalesAmount: null,
        influencerLiveSalesAmount: null,
        influencerProductCardSalesAmount: null,
        influencerOtherSalesAmount: null,
        influencerVideoSalesAmount: null,
        liveNaturalOrderCount: null,
        livePaidOrderCount: null,
        liveOrderCount: null,
        liveViewCount: null,
        liveExposureViewRate: null,
        liveExposureConversionRate: null,
        livePaymentConversionRate: null,
        thousandViewSalesAmount: null,
        productExposureCount: null,
        productExposureClickRate: null,
        productClickConversionRate: null,
        viewProductExposureRate: null,
        liveProductExposureCount: null,
        liveProductClickCount: null,
        liveProductSalesCount: null,
        averageViewDuration: null,
        liveRoi: null,
        dataYear: null,
        dataQuarter: null,
        dataMonth: null,
        dataWeek: null,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.id);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加抖系销售营销数据";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids;
      getBiDySaleDwd(id).then((response) => {
        this.form = response.data;
        this.open = true;
        this.title = "修改抖系销售营销数据";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.id != null) {
            updateBiDySaleDwd(this.form).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addBiDySaleDwd(this.form).then((response) => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal
        .confirm('是否确认删除抖系销售营销数据编号为"' + ids + '"的数据项？')
        .then(function () {
          return delBiDySaleDwd(ids);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download(
        "sale/BiDySaleDwd/export",
        {
          ...this.queryParams,
        },
        `BiDySaleDwd_${new Date().getTime()}.xlsx`
      );
    },
  },
};
</script>
